<?php


namespace App\Models;


use Illuminate\Database\Eloquent\Model;

/**
 * Class EntryorderProduct
 * @property Product $product
 * @package App\Models
 * @author luffyzhao@vip.126.com
 */
class EntryorderProduct extends Model
{
    /**
     * @var array
     * @author luffyzhao@vip.126.com
     */
    protected $fillable = [
        'product_id', 'quantity', 'price'
    ];

    /**
     * @var array
     * @author luffyzhao@vip.126.com
     */
    protected $casts = [
        'quantity' => 'int',
        'price' => 'float',
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     * @author luffyzhao@vip.126.com
     */
    public function product(){
        return $this->belongsTo(Product::class);
    }
}
